#ifndef _SYS_CAST_ERR_H_
#define _SYS_CAST_ERR_H_

#include "Err.h"
#include "SysTypes.h"

#define CAST_ERR_VTABLE(self)   ((CastErrVTable*)((FanObj*)self)->vtable)


extern Type*    CastErr_classType;
extern VTable*  CastErr_classVTable;


/* [sys::CastErr] Attributes */
struct CastErr
{
  Err           super;
};


/* [sys::CastErr] Virtual-table */
typedef struct CastErrVTable
{
  ErrVTable     super;
} CastErrVTable;


/* [sys::CastErr] Methods and fields */
void            CastErr_make_0(CastErr* self);
void            CastErr_make_1(CastErr* self, Str* msg);
void            CastErr_make(CastErr* self, Str* msg, Err* cause);


/* [sys::CastErr] Extra methods */
CastErr*        CastErr_new(Str* msg, Err* cause);
CastErr*        CastErr_newWithFormattedMsg(const char* msgFormat, ...);
CastErr*        CastErr_newWithTypes(Type* from, Type* to);


/* [sys::CastErr] Type-system functions */
Type*           CastErr_initType(void);
VTable*         CastErr_initVTable(void);
void            CastErr_initStatic(void);


#endif
